import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace DressRentalOrderApi {
  /** 婚纱租赁订单信息 */
  export interface DressRentalOrder {
    id: number; // 
    orderId?: string; // 订单ID
    dressCode?: string; // 婚纱编码
    customerId?: string; // 客户ID
    rentStartDate?: string | Dayjs; // 租赁开始日期
    rentEndDate?: string | Dayjs; // 租赁结束日期
    rentDays?: number; // 租赁天数
    totalAmount: number; // 总金额
    depositAmount: number; // 押金
    paidAmount: number; // 已付金额
    status: string; // 订单状态
  }
}

/** 查询婚纱租赁订单分页 */
export function getDressRentalOrderPage(params: PageParam) {
  return requestClient.get<PageResult<DressRentalOrderApi.DressRentalOrder>>('/wedding/dress-rental-order/page', { params });
}

/** 查询婚纱租赁订单详情 */
export function getDressRentalOrder(id: number) {
  return requestClient.get<DressRentalOrderApi.DressRentalOrder>(`/wedding/dress-rental-order/get?id=${id}`);
}

/** 新增婚纱租赁订单 */
export function createDressRentalOrder(data: DressRentalOrderApi.DressRentalOrder) {
  return requestClient.post('/wedding/dress-rental-order/create', data);
}

/** 修改婚纱租赁订单 */
export function updateDressRentalOrder(data: DressRentalOrderApi.DressRentalOrder) {
  return requestClient.put('/wedding/dress-rental-order/update', data);
}

/** 删除婚纱租赁订单 */
export function deleteDressRentalOrder(id: number) {
  return requestClient.delete(`/wedding/dress-rental-order/delete?id=${id}`);
}


/** 导出婚纱租赁订单 */
export function exportDressRentalOrder(params: any) {
  return requestClient.download('/wedding/dress-rental-order/export-excel', { params });
}

